All Questions
198 questions
0votes
1answer
186views
Our php codes base has 6 different ways to do INSERT … ON DUPLICATE KEY UPDATE, how do I fix it?
Our php codes base has 6 different ways to do INSERT … ON DUPLICATE KEY UPDATE. It happened over years because the php framework is evolving and my team members come and go, although I won't say we ...
-2votes
2answers
66views
How to serve customized content to each user, based on targeting criteria?
In my PHP Laravel application, I want to display special offers to users, depending on the quality of their house(s). There are 4 Models: User, House, Offer, OfferTargeting. Each User can have many ...
-3votes
1answer
69views
Server performance and CMS scalability [closed]
I have been given the job of a colleague who has resigned and I don't know where to start. I hope you can give me some hints: It is about a CMS made from scratch (Javascript/jQuery/PHP/MySQL) which ...
2votes
3answers
321views
Is it best practice to always try to return a minimum number of rows from the database?
First-time poster so please be gentle :) I have a rather large table in my database (MySQL in case it matters) that holds lat/lng values of certain points of interest around the world (table name: ...
15votes
6answers
16kviews
Should I use DATE or VARCHAR in storing dates in MySQL?
Simply put, I have date and time attributes on an Orders table. The data types for these attributes are MySQL's DATE attribute. But everytime I echo the date and time in PHP it just gives me a string, ...
-3votes
2answers
178views
Does DigitalOcean offer enough resources to run a scalable MySQL cluster?
I have a Kubernetes instance from DigitalOcean that has 2 worker nodes and 1 load balancer. Now I want to create a MySQL managed database cluster for the app that will run on that Kubernetes. Question ...
0votes
2answers
112views
How can you avoid doing hundreds/thousands of queries when utilizing classes in PHP?
I have been dipping my toes into object orientated PHP programming and I'm finding it useful but I can't help but feel I'm missing something in regards to how to utilize it. Normally my classes and ...
1vote
0answers
58views
Best way to integrate google signin in existing user registration system with PHP/MYSQL [Logic]
I want to integrate google signin, in our existing user registration system. But not sure which approach will be good in terms of data security + user experience (UX) + speed. Even if its a good idea ...
-2votes
3answers
434views
How should I store file history in a MySQl data?
I am creating a web app with JS and PHP where users can edit a file similar to a text editor such as notepad. I've decided to use a database to store these files. One of the primary functions of a ...
-1votes
1answer
181views
Best practices for creating structured data from "flat" SQL query results
Recently I've been working on a project to teach myself PHP and SQL, and as the project has gotten more complex I've been wondering what the idiomatic approaches are for creating the backend models ...
-2votes
1answer
419views
Which Software Architecture am I using? XAMPP, Apache, MySQL, PHP Android
I use XAMPP to host an Apache web server and a MySQL database. Most of the data processing is done on the user's mobile phone. After a certain activity, information of the user is sent to the web ...
1vote
2answers
2kviews
If not used in a declared transaction but used in a try...catch will rollback do anything at all?
My questions are regarding the use of mysqli::rollback. If not used in a declared transaction but used in a try...catch will rollback do anything at all? (autocommit on) If it does work without a ...
2votes
1answer
2kviews
Hidden Input Fields for POST - Security
I have seen some posts on the subject of hidden input fields for use with postbut none were able to answer my question. I have a delete button tied to a user in a table. The delete button uses a ...
1vote
0answers
65views
PHP MySQL Secure Connection - Same Server
I have some php scripts that use mysqli() to connect to MySQL which is located on the same server. I currently have the connection stored outside of my sites root and I am using include() to make the ...
3votes
3answers
831views
Altering Database Tables on the Fly, why is this a Bad Idea?
I recently saw a comment on StackOverflow that basically said it is a bad idea to alter tables on the fly. In my case I have a json file that is storing some information about some "products". One of ...